<h1>
    Users
</h1>
<form method='GET' id='frm_search_user'>
    <div class='wrap-content'>
        <span style='margin-right: 5px'>User Name</span>
        <input type='text' placeholder="Type User Name" id='search_name' name='search_name' value='<?php echo $this->search_name ?>'/>
        <input type='submit' class='submit-button'/>
    </div>
</form>
<form method='POST'>
    <input type='submit' value='Delete' class='delete-item-button' />
    <table cellspacing="0" id='tbl_list'>	
        <thead>
            <tr>
                <th>
                    <input type='checkbox' id='master_check'/>	
                </th>
                <th>
                    User Name
                </th>
                <th>
                    Name
                </th>
                <th>
                    Email
                </th>
                <th>
                    Role
                </th>
                <th>

                </th>
            </tr>
        </thead>
        <tbody>
            <?php foreach ($this->paginator as $user): ?>
                <tr>
                    <td>
                        <input type='checkbox' name='delete_ids[]' value='<?php echo $user->id ?>'/>
                    </td>
                    <td>
                        <?php $edit_url = $this->url(array("action" => "edituser" , "uid" => $user->id)) ?>
                        <a href='<?php echo $edit_url ?>'>
                            <?php echo $user->username ?>
                        </a>
                    </td>
                    <td>
                        <?php echo $user->fullname ?>
                    </td>
                    <td>
                        <?php echo $user->email ?>
                    </td>
                    <td>
                        <?php echo $user->role ?>
                    </td>
                    <td>
                        <input data-url="<?php echo $this->baseUrl() ?>/admin/index/changestatus" data-id="<?php echo $user->id ?>"  data-active="<?php if ($user->is_active == 1): ?>
                            0
                        <?php else: ?>
                           1
                        <?php endif; ?>" type='button'
                               value='<?php if ($user->is_active == 1): ?>Deactive<?php else: ?>Active<?php endif; ?>'
                               class='<?php if ($user->is_active == 1): ?> deactive-item-button<?php else: ?>active-item-button<?php endif; ?>'/>

                    </td>
                </tr>
            <?php endforeach; ?>
        </tbody>
    </table>
</form>
<?php echo $this->paginationControl($this->paginator, "Sliding", "/_partial/paginator.phtml") ?>